/* eslint-disable react/destructuring-assignment */
/* eslint-disable no-underscore-dangle */
/* eslint-disable no-console */
import React, { Component, Suspense } from 'react';
import { connect } from 'dva';
import moment from 'moment';
import qs from 'qs';
import download from '@/utils/download';
import { exportQAHistories } from '@/services/download';
import PageHeaderWrapper from '@/components/PageHeaderWrapper';
import PageLoading from '@/components/PageLoading';
import { FormattedMessage } from 'umi-plugin-react/locale';
import EditQa from '../../KnowledgeManagement/Overview/editQa';
import { Card, Form, Row, Col, Button, Select, DatePicker, Table, Icon, Spin, message, Input, Modal, Drawer, Tooltip, Menu, Dropdown, } from 'antd';
import Relevance from '../../../modules/popoutRelevance';
import UpDownCharacter from '../../../modules/UpDownCharacter';
import dataTime from '../../../utils/dataTime';
import styles from './index.less';
import SynonymModal from '@/pages/DataStatistics/AnswerRecords/synonymModal';
import EditingKnowledge from '@/pages/KnowledgeManagement/Overview/EditingKnowledge/editingKnowledge';
import { getAuthority } from '@/utils/judgeAuthority';

// eslint-disable-next-line import/no-unresolved
// const EditQa = React.lazy(() => import('../../KnowledgeManagement/Overview/editQa'));

const FormItem = Form.Item;
const { RangePicker } = DatePicker;
const dateFormat = 'YYYY/MM/DD';
const Option = Select.Option;
const Search = Input.Search;
@connect(({ answerRecords, loading }) => ({
  answerRecords,
  loading: loading.effects['answerRecords/fetch'],
}))
class AnswerRecords extends Component {
  constructor() {
    super();
    this.state = {
      upDownDate: [],
      login: false,
      logins: true,
      showModel4: false,
      from: '',
      to: '',
      page: 1,
      limit: 10,
      userId: '',
      resolvedFlag: null,
      sentiment: '',
      question: '', // 关联列表参数开始
      field: 'q',
      query: '',
      pageA: '',
      pageSizeA: '',
      id: '', // 上下文参数
      loginjqr: false,
      zuid: '',
      shutRelevance: false,
      showModel1: false,
      numberRadio: '1',
      pageSizetwo: 10,
      pagetwo: 1,
      nodeId: '',
      nodeIdName: '所有分类',
      close: false,
      qaId: '',
      isUpdate: false,
      aALeng: '',
      glLeng: 10,
      questiona: '',
      total: 0,
      dataSource: [],
      a: false,
      img: '',
      replayBeginTime: '',
      replayOverTime: '',
      synonymVisible: false,
      showSynonym: false,
      copyText: '',
      doctorList: [],
      handlerList: [],
    };
  }

  // eslint-disable-next-line react/sort-comp
  componentDidMount() {
    //获取医生
    this.getDoctorList();
    // //获取处理人
    this.getHandlerList();
    this.request();
  }

  getDoctorList = () => {
    const { dispatch } = this.props;
    dispatch({
      type: 'answerRecords/fetchDoctorList',
      payload: {},
      callback: res => {
        // console.log(res);
        this.setState({ doctorList: res.list, });
      },
    });
  };

  getHandlerList = () => {
    const { dispatch } = this.props;
    dispatch({
      type: 'answerRecords/fetchHandlerList',
      payload: {},
      callback: res => {
        // console.log(res);
        this.setState({ handlerList: res.list, });
      },
    });
  };

  // 渲染页面前调用一次
  // eslint-disable-next-line react/sort-comp
  componentWillMount() {
    // let sysTime = dataTime.formatDate(new Date().getTime(),"yyyy-MM-DD"); // 初始时间
    let sysTime = moment().format('YYYY-MM-DD');
    let toTime = moment().subtract('days', 7).format('YYYY/MM/DD'); // 初始时间
    this.setState({ beginTime: toTime.replace(/\//g, '-'), overTime: sysTime, });
  }

  // 动态获取mock数据
  request = () => {
    this.setState({ login: true, });
    const { dispatch, currentUser } = this.props;
    const { page, limit } = this.state;
    const formData = this.props.form.getFieldsValue();
    // console.log(formData);
    this.reqRef = requestAnimationFrame(() => {
      dispatch({
        type: 'answerRecords/fetch',
        payload: {
          from:
            formData.handleTime && formData.handleTime.length > 0
              ? formData.handleTime[0].format('YYYY-MM-DD')
              : '',
          to:
            formData.handleTime && formData.handleTime.length > 0
              ? formData.handleTime[1].format('YYYY-MM-DD')
              : '',
          replyStart:
            formData.replayTime && formData.replayTime.length > 0
              ? formData.replayTime[0].format('YYYY-MM-DD')
              : '',
          replyEnd:
            formData.replayTime && formData.replayTime.length > 0
              ? formData.replayTime[1].format('YYYY-MM-DD')
              : '',
          page,
          limit,
          resolveFlag: formData.resolveFlag ? formData.resolveFlag : '',
          query: '',
          questionStatus: formData.questionStatus ? formData.questionStatus : '',
          doctor: formData.doctor ? formData.doctor : '',
          processPerson: formData.processPerson ? formData.processPerson : '',
        },
        callback: res => {
          if (res.list) {
            this.setState({ login: false, });
          };
          res.list.map((item, index) => {
            item['key'] = index;
          });
          this.setState({ dataSource: res.list, total: res.total, });
        },
      });
    });
  };

  // 获取关联列表数据
  AnswerRelevance = (question, field, query, page, pageSize) => {
    this.setState({ logins: true, });
    const { dispatch, currentUser } = this.props;
    dispatch({
      type: 'answerRecords/fetchb',
      payload: { question, field, query, page, limit: pageSize },
      callback: res => {
        let aA = res.suggestList;
        let bB = res.qaList;
        let aALeng = res.suggestList.length;
        let bBLeng = res.qaList.length;

        const total = [...aA, ...bB];
        total.map((item, index) => {
          item['key'] = index;
        });
        this.setState({
          total2: parseInt(res.total),
          qaListTable: total,
          logins: false,
          aALeng: aALeng,
          glLeng: Number(aALeng + bBLeng),
        });
      },
    });
  };

  // 获取上下文列表数据
  upDownDate = (ids) => {
    this.setState({ loginjqr: true, updowndate: [], });
    const { dispatch, currentUser } = this.props;
    dispatch({
      type: 'answerRecords/fetchc',
      payload: { id: this.state.id },
      callback: res => {
        res.list.map((item, index) => {
          item['key'] = index;
        });
        this.setState({ upDownDate: res.list, loginjqr: false, });
      },
    });
  };

  // 查看
  handleSubmit = () => {
    this.setState({ page: 1, }, () => {
      this.request();
    });
  };

  // eslint-disable-next-line react/sort-comp
  onChangeA = val => {
    // 页数选择
    this.setState({ page: val, });
    this.request();
  };

  // 每页显示多少条数据
  onShowSizeChangeA = (current, pageSize) => {
    this.setState({ page: current, limit: pageSize, });
    this.request();
  };

  handleDelete = item => {
    const { dispatch, currentUser } = this.props;
    dispatch({
      type: 'answerRecords/fetchd',
      payload: { question: this.state.question, sid: item.sid },
      callback: res => {
        message.info(res.msg);
        // console.log(res);
        if (res.data) {
          this.props.form.setFields({ businessName: '' });
          this.setState({ showModel1: false });
          this.updateResolvedStatus()
        }
      },
    });
  };

  handleDeletes = item => { };

  // 搜索内容
  onFrom = val => {
    this.setState({ pageA: 1, pageSizeA: 10, query: val, }, () => {
      if (val === '') {
        this.AnswerRelevance(this.state.question, this.state.field, this.state.query, 1, 10);
      } else {
        this.AnswerRelevance(val, this.state.field, this.state.query, 1, 10);
      }
    });
  };

  // 搜索问题
  onFromA = val => {
    this.setState({ pageA: 1, pageSizeA: 10, field: val, });
    setTimeout(() => {
      this.AnswerRelevance(this.state.question, this.state.field, this.state.query, 1, 10);
    });
  };

  handleSubmitComment = current => {
    this.AnswerRelevance(this.state.question, this.state.field, this.state.query, current, this.state.pageSizetwo);
  };

  handleSubmitComments = (a, b) => {
    this.setState({ pageSizetwo: b });
    this.AnswerRelevance(this.state.question, this.state.field, this.state.query, a, b);
  };

  // 上下文组件回调函数
  handleSubUpDwonDate = val => {
    this.setState({ id: val.id, updowndate: [], });
    setTimeout(() => {
      this.upDownDate(this.state.id);
    }, 1);
  };

  // 新增按钮11
  newlyIncreased = text => { };

  setClassName = (record, index) => {
    return index < this.state.aALeng ? styles.red : '';
  };

  empty = () => {
    this.setState({ upDownDate: [] });
  };

  export = () => {
    const { dispatch, currentUser } = this.props;
    const formData = this.props.form.getFieldsValue();
    const { page, limit } = this.state;
    // console.log(formData);
    const data = {
      from:
        formData.handleTime && formData.handleTime.length > 0
          ? formData.handleTime[0].format('YYYY-MM-DD')
          : '',
      to:
        formData.handleTime && formData.handleTime.length > 0
          ? formData.handleTime[1].format('YYYY-MM-DD')
          : '',
      replyStart:
        formData.replayTime && formData.replayTime.length > 0
          ? formData.replayTime[0].format('YYYY-MM-DD')
          : '',
      replyEnd:
        formData.replayTime && formData.replayTime.length > 0
          ? formData.replayTime[1].format('YYYY-MM-DD')
          : '',
      page,
      limit,
      resolvedFlag: formData.resolvedFlag ? formData.resolvedFlag : '',
      query: '',
      questionStatus: formData.questionStatus ? formData.questionStatus : '',
      doctor: formData.doctor ? formData.doctor : '',
      processPerson: formData.processPerson ? formData.processPerson : '',
    };
    dispatch({
      type: 'answerRecords/listChat',
      payload: data,
      callback: res => {
        let filename = res.requestRes.headers.get('Content-Disposition').split('=')[1];
        download.byBlob(res.fileBlob, filename);
      },
    });
    // exportQAHistories(data, url) listChat
  };

  //  关联方法
  handleOpen = row => {
    this.props.form.setFields({ businessName: '' });
    this.setState({ question: row.question, query: '' }, () => {
      this.AnswerRelevance(this.state.question, this.state.field, this.state.query, 1, 10);
      this.setState({ showModel1: true, zuid: row.id });
    });
  };

  // 新增
  addhandleOpen = row => {
    // console.log(Array(row.question.replace(/<.*?>/g, '')));
    this.setState({ qaId: Array(row.question.replace(/<.*?>/g, '')), zuid: row.id }, () => {
      this.EditingKnowledge.showEditDrawer(null, row.question.replace(/<.*?>/g, ''));
    });
  };

  onClose = () => {
    this.setState({ close: false, });
  };

  openGaller = item => {
    this.setState({ img: item, a: true, });
  };

  rightClick = visible => {
    let text = '';
    if (window.getSelection) {
      text = window.getSelection();
    } else if (document.selection) {
      text = document.selection.createRange();
    };
    // console.log(text.toString());
    if (text.toString() && visible) {
      this.setState({ copyText: text.toString(), synonymVisible: visible, });
    } else {
      this.setState({ synonymVisible: false, });
    }
  };

  showSynonymModal = () => {
    const { synonymVisible } = this.state;
    if (synonymVisible) {
      this.setState({ showSynonym: true, }, () => {
        this.SynonymModal.getSynonymList();
      });
    } else {
      message.info('请选中需要添加的同义词');
    }
  };

  closeSynonymModal = () => {
    this.setState({ showSynonym: false, });
  };

  igoreRecord = item => {
    const { dispatch, currentUser } = this.props;
    dispatch({
      type: 'answerRecords/igoreRecord',
      payload: {
        id: item.id,
        processPersonId: currentUser.uid,
        resolveFlag: 3,
        processPerson: currentUser.nick
      },
      callback: res => {
        message.info(res.msg);
        this.request();
      },
    });
  };

  refreshList = () => {
    this.request();
  };

  updateResolvedStatus = () => {
    const { dispatch, currentUser } = this.props;
    dispatch({
      type: 'answerRecords/igoreRecord',
      payload: {
        id: this.state.zuid,
        processPersonId: currentUser.uid,
        resolveFlag: 2,
        processPerson: currentUser.nick
      },
      callback: res => {
        message.info(res.msg);
        this.request();
      },
    });
  }

  render() {
    const menu = (
      <Menu>
        <Menu.Item key="1" onClick={this.showSynonymModal}>
          同义词
        </Menu.Item>
      </Menu>
    );
    const { getFieldDecorator } = this.props.form;
    let { dataSource, synonymVisible, showSynonym, copyText, doctorList, handlerList } = this.state;
    const { route } = this.props;
    const columns1 = [
      {
        title: '问题',
        dataIndex: 'question',
        width: 'calc(30vw)',
        render(item) {
          return (
            <div className={styles.hull}>
              <span>{item}</span>
            </div>
          );
        },
      },
      {
        title: '分类',
        dataIndex: 'category',
        width: 'calc(30vw)',
        render(item) {
          return (
            <div className={styles.hull}>
              <span>{item}</span>
            </div>
          );
        },
      },
      {
        title: '操作',
        render: (text, item) => {
          return (
            <div className={styles.pb}>
              <div
                className={styles.buttongl}
                onClick={text => {
                  this.handleDelete(item);
                }}
              >
                {/* <MyIcon  type="icon-bi" /> */}
                <span>
                  <Icon size="small" type="link" style={{ marginRight: 5 }} />
                </span>
                <span>关联</span>
              </div>
            </div>
          );
        },
      },
    ];
    const columns = [
      {
        title: '序号',
        width: 'calc(15vw)',
        dataIndex: 'num',
      },
      {
        title: '患者问题',
        width: 'calc(15vw)',
        dataIndex: 'question',
        render: item => (
          <Dropdown overlay={menu} trigger={['contextMenu']} onVisibleChange={this.rightClick}>
            <div
              className={styles.wtbj}
              style={{ maxWidth: 150 }}
              dangerouslySetInnerHTML={{ __html: item }}
            />
          </Dropdown>
        ),
      },
      {
        title: '回复内容',
        width: 'calc(25vw)',
        dataIndex: 'answer',
      },
      {
        title: '标准问',
        width: 'calc(10vw)',
        dataIndex: 'stdQuestion',
      },
      {
        title: '推荐答案',
        width: 'calc(25vw)',
        dataIndex: 'recommendAnswer',
      },
      {
        title: '医生',
        dataIndex: 'doctor',
        width: 'calc(10vw)',
      },
      {
        title: '回复时间',
        dataIndex: 'replyTime',
        width: 'calc(10vw)',
        render(dataIndex) {
          if (dataIndex) {
            return moment(dataIndex).format('YYYY-MM-DD HH:mm:ss');
          } else {
            return '';
          }
        },
      },
      {
        title: '问题状态',
        dataIndex: 'questionStatus',
        width: 'calc(10vw)',
        render: item => {
          let text = '';
          switch (item) {
            case 1:
              text = '已知-直接引用';
              break;
            case 2:
              text = '已知-编辑引用';
              break;
            case 3:
              text = '已知未引用';
              break;
            case 4:
              text = '未知';
              break;
          }
          return text;
        },
      },
      {
        title: '处理人',
        dataIndex: 'processPerson',
        width: 'calc(10vw)',
      },
      {
        title: '处理状态',
        dataIndex: 'resolveFlag',
        width: 'calc(10vw)',
        render: item => {
          let text = '';
          switch (item) {
            case 1:
              text = '未处理';
              break;
            case 2:
              text = '已处理';
              break;
            case 3:
              text = '已忽略';
              break;
          }
          return text;
        },
      },
      {
        title: '处理时间',
        dataIndex: 'processTime',
        width: 'calc(10vw)',
        render(dataIndex) {
          if (dataIndex) {
            return moment(dataIndex).format('YYYY-MM-DD HH:mm:ss');
          } else {
            return '';
          }
        },
      },
      {
        title: '操作',
        fixed: 'right',
        render: (text, item) => {
          return (
            <div className={styles.pb}>
              <div className="zdyButtonA">
                <Button
                  type="primary"
                  icon="link"
                  size="small"
                  style={{ marginRight: '5px' }}
                  onClick={() => this.igoreRecord(item)}
                  disabled={getAuthority(route.authority) === 1}
                >
                  忽略
                </Button>
              </div>
              <div className="zdyButtonA">
                <Button
                  type="primary"
                  icon="link"
                  size="small"
                  onClick={() => this.handleOpen(item)}
                  disabled={getAuthority(route.authority) === 1}
                >
                  关联
                </Button>
              </div>
              <div className="zdyButtonA">
                <Button
                  onClick={() => this.addhandleOpen(item)}
                  style={{ margin: '0px 5px' }}
                  disabled={this.state.showModel4}
                  type="primary"
                  icon="plus"
                  size="small"
                // disabled={getAuthority(route.authority) === 1}
                >
                  新增
                </Button>
              </div>
              <UpDownCharacter
                text={text}
                name="上下文"
                icons="bars"
                title="聊天上下文"
                updowndate={this.state.upDownDate}
                onSubmitA={this.handleSubUpDwonDate}
                loginjqr={this.state.loginjqr}
                empty={this.empty}
              />
            </div>
          );
        },
      },
    ];
    return (
      <Suspense fallback={<PageLoading />}>
        <PageHeaderWrapper>
          <div className={styles.overall}>
            <div className={styles.overall}>
              <Row className={styles.colorBackground}>
                <div className={styles.simur}>
                  <div>
                    <div className={styles.buttonAB}>
                      <span className={styles.AccessTrend} />
                      {/* <span>问答记录</span> */}
                      <span
                        style={{
                          fontSize: 16,
                          color: '#4B5475',
                          borderLeft: '5px solid #13c2f3',
                          paddingLeft: 10,
                          fontWeight: 600,
                        }}
                      >
                        <FormattedMessage
                          id="app.answerRecords.issue-record"
                          defaultMessage="Issue record"
                        />
                        {`(${this.state.total})`}
                      </span>
                      <span style={{ marginLeft: 12, marginTop: 5 }}>
                        <Tooltip
                          placement="top"
                          title="1、机器人所有问答会话都在这里，可任意切换时间查看下载。2、关联：即把当前问句关联到库内某个知识点中，成为它的相似问。3、新增：即把当前问句新增为一个知识点。4、上下文：即查看该会话发生情景。5、评价：该评价指用户对机器人回复答案的评价，已解决为赞，未解决为踩。"
                          arrowPointAtCenter
                        >
                          <Icon type="info-circle" />
                        </Tooltip>
                      </span>
                    </div>
                  </div>
                </div>
              </Row>
              <Row style={{ padding: '0 20px', background: '#fff' }}>
                <div>
                  <Form className={styles.buttonA} layout="inline">
                    <FormItem>
                      {getFieldDecorator('replayTime')(
                        <RangePicker
                          style={{ width: 220 }}
                          format={dateFormat}
                          placeholder={['回复开始时间', '回复结束时间']}
                        />
                      )}
                    </FormItem>
                    <FormItem>
                      {getFieldDecorator('questionStatus')(
                        <Select style={{ width: 160 }} placeholder={'问题状态'}>
                          <Option value="">全部</Option>
                          <Option value={1}>已知-直接引用</Option>
                          <Option value={2}>已知-编辑引用</Option>
                          <Option value={2}>已知-未引用</Option>
                          <Option value={4}>未知</Option>
                        </Select>
                      )}
                    </FormItem>
                    <FormItem>
                      {getFieldDecorator('resolveFlag')(
                        <Select style={{ width: 160 }} placeholder={'处理状态'}>
                          <Option value="">全部</Option>
                          <Option value={2}>已处理</Option>
                          <Option value={3}>已忽略</Option>
                          <Option value={1}>未处理</Option>
                        </Select>
                      )}
                    </FormItem>
                    <FormItem>
                      {getFieldDecorator('doctor')(
                        <Select style={{ width: 160 }} placeholder={'请选择医生'}>
                          <Option value="">全部</Option>
                          {doctorList.map((item, index) => {
                            return (
                              <Option value={item} key={item}>{item}</Option>
                            );
                          })}
                        </Select>
                      )}
                    </FormItem>
                    <FormItem>
                      {getFieldDecorator('processPerson')(
                        <Select style={{ width: 160 }} placeholder={'请选择处理人'}>
                          <Option value="">全部</Option>
                          {handlerList.map((item, index) => {
                            return (
                              <Option value={item} key={item}>{item}</Option>
                            );
                          })}
                        </Select>
                      )}
                    </FormItem>
                    <FormItem>
                      {getFieldDecorator('handleTime')(
                        <RangePicker
                          style={{ width: 220 }}
                          format={dateFormat}
                          placeholder={['处理开始时间', '处理结束时间']}
                        />
                      )}
                    </FormItem>

                    <FormItem className="buttonYs">
                      <Button onClick={this.handleSubmit} icon="check">
                        {/* 查看 */}
                        <FormattedMessage id="app.answerRecords.examine" defaultMessage="Examine" />
                      </Button>
                    </FormItem>

                    <FormItem className="buttonYs">
                      <Button onClick={this.export} icon="arrow-down">
                        {/* 下载 */}
                        <FormattedMessage
                          id="app.answerRecords.download"
                          defaultMessage="Download"
                        />
                      </Button>
                    </FormItem>
                  </Form>
                </div>
              </Row>
              <div
                className="tableyc"
                style={{ backgroundColor: ' #ffffff', minHeight: ' calc(100vh - 210px)' }}
              >
                <Spin spinning={this.state.login}>
                  <Table
                    className="zdyTable"
                    style={{ padding: '20px 20px 0px 20px' }}
                    scroll={{ x: 1500 }}
                    columns={columns}
                    dataSource={dataSource}
                    rowKey={'id'}
                    pagination={{
                      // 分页
                      total: this.state.total, // 数据总数量
                      pageSize: this.state.limit, // 显示几条一页
                      current: this.state.page, // 默认显示几条一页
                      showSizeChanger: true, // 是否显示可以设置几条一页的选项
                      showQuickJumper: true,
                      onChange: this.onChangeA,
                      onShowSizeChange: this.onShowSizeChangeA,
                    }}
                  />
                </Spin>
              </div>
              <Modal
                style={{ top: 60 }}
                width={'calc(70vw)'}
                className={styles.overa}
                title="添加关联知识点"
                visible={this.state.showModel1}
                footer={null}
                onCancel={() => {
                  this.setState({ showModel1: false, });
                }}
                onOk={() => {
                  // 确定方法不开出去
                  this.setState({ showModel1: false, });
                }}
              >
                <Form layout="inline" style={{ paddingBottom: 20 }}>
                  <FormItem style={{ marginLeft: 20 }}>
                    <Select
                      defaultValue={this.state.numberRadio}
                      style={{ width: 160 }}
                      onChange={this.onFromA}
                    >
                      <Option value="1">问答知识点</Option>
                      <Option value="2">导图知识点</Option>
                      <Option value="3">多轮会话</Option>
                    </Select>
                  </FormItem>
                  <FormItem>
                    {getFieldDecorator('businessName', { initialValue: '', })(
                      <Search
                        placeholder="请输入搜索内容"
                        onSearch={value => {
                          this.onFrom(value);
                        }}
                        style={{ width: 320 }}
                      />
                    )}
                  </FormItem>
                </Form>
                <Spin spinning={this.state.logins}>
                  <Table
                    rowClassName={this.setClassName}
                    className={styles.over}
                    // bordered
                    columns={columns1}
                    dataSource={this.state.qaListTable}
                    pagination={{
                      // 分页
                      total: this.state.total2, // 数据总数量
                      pageSize: this.state.glLeng, // 显示几条一页
                      defaultPageSize: this.state.pagetwo, // 当前页
                      // showSizeChanger: true,  // 是否显示可以设置几条一页的选项
                      showQuickJumper: true,
                      onChange: this.handleSubmitComment,
                      onShowSizeChange: this.handleSubmitComments,
                    }}
                  />
                </Spin>
              </Modal>
              <Modal
                style={{
                  maxHeight: ' 90%',
                  display: 'flex',
                  justifyContent: 'center',
                  alignItems: 'center',
                }}
                width={'calc(80vw)'}
                height={'calc(80vh)'}
                className="modalovel"
                visible={this.state.a}
                title="图片详情"
                onCancel={() => {
                  this.setState({ a: false, });
                }}
                footer={null}
              >
                {<div dangerouslySetInnerHTML={{ __html: this.state.img }} />}
              </Modal>
              {/*<Drawer*/}
              {/*  title={<FormattedMessage id="app.overView.editQa" />}*/}
              {/*  placement="right"*/}
              {/*  closable*/}
              {/*  onClose={this.onClose}*/}
              {/*  visible={this.state.close}*/}
              {/*  width={800}*/}
              {/*  destroyOnClose*/}
              {/*>*/}
              {/*  <EditQa qaId="" questions={this.state.qaId} onClose={this.onClose} />*/}
              {/*</Drawer>*/}
              <EditingKnowledge
                onRef={ref => (this.EditingKnowledge = ref)}
                refreshList={this.refreshList}
                categoryId={'root'}
                answerRecordsId={this.state.zuid}
                updateResolvedStatus={this.updateResolvedStatus}
              />
              <SynonymModal
                visible={showSynonym}
                copyText={copyText}
                onClose={this.closeSynonymModal}
                onRef={ref => (this.SynonymModal = ref)}
              />
            </div>
          </div>
        </PageHeaderWrapper>
      </Suspense>
    );
  }
}

export default connect(({ user }) => ({
  // 全局数据
  currentUser: user.currentUser,
}))(Form.create()(AnswerRecords));
